package pack1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by jack on 2017/7/5.
 * 事件
 */
public class Main
{
    public static void main(String[] args)
    {
        System.out.println("start");
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(EventConfig.class);

        DemoPublisher demoPublisher = context.getBean(DemoPublisher.class);

        System.out.println("gotBean DemoPublisher.class");

        demoPublisher.publish("hello application event");

        System.out.println("demoPublisher.published");

        context.close();
        System.out.println("context.close()");
    }
}
